package models

// chatGroup 对应数据库表 chat_group_relation
/*
  `group_id` int DEFAULT '0' COMMENT '分组id',
  `user_id` int DEFAULT '0' COMMENT '用户id ',
  `user_type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'admin' COMMENT '类型  member 用户, admin 管理员',
*/
type ChatGroupRelation struct {
	ID       uint   `gorm:"primaryKey;autoIncrement;comment:主键，自增ID"`
	GroupID  uint   `gorm:"default:0;comment:分组id"` // Fixed missing closing quote
	UserID   uint   `gorm:"default:0;comment:用户id"` // Fixed missing closing quote
	UserType string `gorm:"default:admin;comment:类型  member 用户, admin 管理员"`
}
type ChatGroupRelationCreate struct {
	GroupID  uint   `json:"group_id"`
	UserID   uint   `json:"user_id"`
	UserType string `json:"user_type"`
}

type ChatGroupRelationUpdate struct {
	ID       uint   `json:"id"`
	GroupID  uint   `json:"group_id"`
	UserID   uint   `json:"user_id"`
	UserType string `json:"user_type"`
}

// TableName 设置表名为 chat_group_relation
func (ChatGroupRelation) TableName() string {
	return "chat_group_relation"
}
